#定义分类商品访问数量序列化器,
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer

from apps.goods.models import GoodsVisitCount


class GoodsSerializer(ModelSerializer):
    category = serializers.StringRelatedField(read_only=True)
    class Meta:
        model = GoodsVisitCount
        fields = ['category','count']